<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文字识别定位演示</title>
    <style>
    body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f7f7f7;
}

.upload-container {
    text-align: center;
    background: #fff;
    padding: 20px 20px 50px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h2 {
    color: #000000ba;
}

.file-upload-wrapper {
    position: relative;
    margin: 20px 0;
}

input[type=file] {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.file-upload-button:hover {
    background-color: #0056b3;
}

.file-upload-filename {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
    color: #666;
}

.upload-button {
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.upload-button:hover {
    background-color: #1c7430;
}
</style>
</head>
<body>
    <div class="upload-container">
        <h2>文字识别定位演示</h2>
        <form id="uploadForm" action="/upload" method="post" enctype="multipart/form-data">
            <div class="file-upload-wrapper">
                <input type="file" name="file" id="file" accept="image/*,.pdf,.docx,.txt" required>
                <label for="fi11le" class="file-upload-button">
                    上传文件
                </label>
                <span class="file-upload-filename" id="filename">未选择文件</span>
            </div>
            <button type="submit" class="upload-button">提交</button>
        </form>
    </div>
</body>
</html>
<script>
document.getElementById('file').addEventListener('change', function(event) {
    var filename = event.target.files[0].name;
    document.getElementById('filename').textContent = filename;
});</script>